from django.contrib.auth.models import Group, Permission
from rest_framework import serializers

class GroupSerializer(serializers.ModelSerializer):
    """
    用户组序列化器
    """
    class Meta:
        model = Group
        fields = "__all__"

class GroupPermissionSerializer(serializers.ModelSerializer):
    """
    权限序列化器
    """
    class Meta:
        model = Permission
        # 两种均可
        fields = ["id","name","codename","content_type"]
        # fields = "__all__"